﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Complete.Data.Support
{
	public static class TypeExtensions
	{
		public static bool IsComplexType(this Type t)
		{
			if (Type.GetTypeCode(t) != TypeCode.Object)
				return false;
			if (t.IsGenericType)
				if (t.GetGenericTypeDefinition() == typeof(Nullable<>))
					if (Type.GetTypeCode(t.GetGenericArguments()[0]) != TypeCode.Object)
						return false;
			return true;
		}
	}
}
